<%= form_for(order) do |f| %>
  <% if order.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(order.errors.count, "error") %> 
      prohibited this order from being saved:</h2>

      <ul>
      <% order.errors.full_messages.each do |message| %>
        <li><%= message %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="field">
    <%= f.label :name %>
    <%= f.text_field :name,  size: 40 %>
  </div>

  <div class="field">
    <%= f.label :address %>
    <%= f.text_area :address,  rows: 3, cols: 40 %>
  </div>

  <div class="field">
    <%= f.label :email %>
    <%= f.email_field :email, size: 40 %>
  </div>

  <div class="field">
    <%= f.label :pay_type %>
    <%= f.select :pay_type, Order.pay_types.keys,
                  prompt: 'Select a payment method' %>
  </div>

  <div class="actions">
     <%= f.submit 'Place Order' %>
  </div>
<% end %>
